import { handleLocalStorage } from "@/utils";

//设置token
const setToken = (token = "") => {
  if (!token) {
    return false;
  }
  handleLocalStorage.set("_token", token);
  return true;
};

//读取token
const getToken = () => {
  let _token = handleLocalStorage.get("_token");
  if (_token) {
    return _token;
  }
  return false;
};

//销毁token
const clearToken = () => {
  handleLocalStorage.remove("_token");
};

export default {
  setToken,
  getToken,
  clearToken,
};
